from django.db import models
from tools.basemodel import BaseModel
from user.models import User


class Carts(BaseModel):
    user = models.ForeignKey(User,on_delete=models.CASCADE,verbose_name='用户')
    sku = models.ForeignKey('goods.SKU',on_delete=models.CASCADE,verbose_name='商品')
    selected = models.BooleanField(default=True,verbose_name='是否选中')
    count = models.IntegerField(default=0,verbose_name='数量')
    is_delete = models.BooleanField(default=False,verbose_name='是否删除')

    class Meta:
        db_table= 'tb_carts'
        verbose_name = '购物车'
        verbose_name_plural='购物车'